const genSetting = (data)=> {
  const { appContextPath } = data 
  const userCenterHomeUrl = `${appContextPath}/home/index.html#`
  const logoutUrl = `${appContextPath}/cas/logout`
  const studentWebUrl = `${appContextPath}/program-center/student/index.html#`
  const instructorWebUrl = `${appContextPath}/program-center/instructor/index.html#`
  const programCenterUrl = `${appContextPath}/program-center`
  
  return Object.assign({}, {
    userCenterHomeUrl,
    logoutUrl,
    studentWebUrl,
    instructorWebUrl,
    programCenterUrl
  }, data)
}

export default (state = {}, action) => {
  switch (action.type) {
    case 'GET_SETTINGS':
      return genSetting(action.data)
    default:
      return state
  }
}


